<?php 
namespace App\Infra\User;

use App\Models\WeChatUserInfo;
use App\Utils\ModelSDK\ModelOperator;
use App\Models\WeChatUser;

class UserManage{

	use ModelOperator;

	public function createUser($data){
		$this->create(WeChatUserInfo::class,$data);
	}

	public function getUserInfo($conditions){
		return $this->findModel(WeChatUser::class,WeChatUser::query()->with(['wechatUserInfo']),$conditions);
	}

	public function getUser($conditions){
		return $this->findModel(WeChatUser::class,WeChatUser::query(),$conditions);
	}

	public function updateUserInfo($id,$data){
		$this->update(WeChatUserInfo::class,$id,$data);
	}
}